package com.cn.lyl.dao.impl;

import com.cn.lyl.dao.NewsTypeDependenceDao;
import com.cn.lyl.model.NewsTypeDependenceModel;
import com.cn.lyl.util.JDBC;

import java.util.List;

public class NewsTypeDependenceDaoImpl implements NewsTypeDependenceDao {
    @Override
    public int add(NewsTypeDependenceModel newsTypeDependenceModel) {

        String sql ="INSERT INTO news_type_dependence (news_id,type_id,create_time, update_time, enable, remark)" +
                "VALUES ("+newsTypeDependenceModel.getNewsId()+","+newsTypeDependenceModel.getTypeId()+",now(),now(),1,'')";
        System.out.println(sql);
        return JDBC.update(sql);
    }

    @Override
    public int update(NewsTypeDependenceModel NewsTypeDependenceModel) {
        return 0;
    }

    @Override
    public int delete(NewsTypeDependenceModel newsTypeDependenceModel) {
        String sql ="delete from news_type_dependence where news_id ="+newsTypeDependenceModel.getNewsId();
        return JDBC.update(sql);
    }

    @Override
    public NewsTypeDependenceModel findById(int id) {
        return null;
    }

    @Override
    public List<NewsTypeDependenceModel> findAll(NewsTypeDependenceModel NewsTypeDependenceModel) {
        return null;
    }
}
